(function(){
    var app = {};
    //判断终端设备
    app.parseUA = function(){
        var u = navigator.userAgent;
        var u2 = navigator.userAgent.toLowerCase();
        return { //移动终端版本信息
            mobile: !!u.match(/(iPhone|iPod|Android|ios|Mobile)/i), //是否为移动终端
            pc: !u.match(/(iPhone|iPod|Android|ios|Mobile)/i), //是否为pc终端
            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //是否为ios终端
            android: u.indexOf('Android') > -1, //是否为android终端
            weixin: u2.match(/MicroMessenger/i) == "micromessenger", //是否为微信客户端
        };
    };
    //判断横屏竖屏
    app.landscape = function(){
        function updateOrientation(){
            if (window.orientation==180||window.orientation==0) {  //竖屏
                return 'sp'
            }
            if (window.orientation==90||window.orientation==-90){ //横屏
                return 'hp'
            }
        }
        return updateOrientation();
        window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize",function(){return updateOrientation()}, false);
    };
    // 初始化方法
    app.init = function(){
        window.netease = app; // 对外提供netease对象
        window.netease.ua =app.parseUA(); //对外提供了UA方法
        window.netease.landscape = app.landscape();
    };
    app.init();
})();
document.body.addEventListener('touchmove' , function(e){
    e.preventDefault();
});